package com.group6.exam.student.service;

import java.util.List;
import java.util.Map;

import com.group6.exam.student.dao.IStudentDao;
import com.group6.exam.student.dao.StudentDaoImpl;
import com.group6.exam.student.entity.StudentEntity;

public class StudentServiceImpl implements IStudentService {

	private IStudentDao studentDao = new StudentDaoImpl();
	
	/* (non-Javadoc)
	 * @see com.group6.exam.student.service.IStudentService#login(com.group6.exam.student.entity.StudentEntity)
	 */
	public boolean login(StudentEntity student){
		return studentDao.login(student);
	}

	/**
	 * 查询主菜单
	 */
	public List<Map<String, Object>> getMainMenus(String studentno) {
		// TODO Auto-generated method stub
		return studentDao.getMainMenus(studentno);
	}

	/**
	 * 查询子菜单
	 */
	public List<Map<String, Object>> getChildMenus(String studentno) {
		// TODO Auto-generated method stub
		return studentDao.getChildMenus(studentno);
	}
	
	public List<Map<String, Object>> search(String studentno){
		
		return studentDao.search(studentno);
	}

	/**
	 * 修改密码
	 */
	public int update(String studentsno, String newpassword) {
		
		return studentDao.update(studentsno,newpassword);
	}

	/**
	 * 修改电话
	 * @see com.group6.exam.student.service.IStudentService#updatephone(java.lang.String, java.lang.String)
	 */
	public int updatephone(String stuno,String stuphone) {
		
		return studentDao.updatephone(stuno,stuphone);
	}

	@Override
	public List<Map<String, Object>> score(String stuno) {
		
		return studentDao.score(stuno);
	}

	@Override
	public List<Map<String, Object>> start(String stuno) {
		
		return studentDao.start(stuno);
	}
	
}
